<template>
 <div class="main">
    <ul>
      <li v-for="(item,index) in list" :key="item.id">{{index+1}}. {{item.name}}
        <!-- <button @click="$emit('del',item.id)">删除</button> -->
        <button @click="del(item.id)">删除</button>
      </li>
      
    </ul>
  </div>
</template>
<script>
export default{
    name:'',
     props:{
      list:{
        type:Array,
        default:()=>[]
      }
    },
    data () {
        return {
            
        }
    },
    created () {
    },
    computed:{
    },
    methods:{
      del(id){
        this.$emit('del',id)
      }
    }
}
</script>
<style lang='less'  scoped>
.main{
  background-color: greenyellow;
}
    
</style>
